fun main() {
    //要获得函数饮用，使用：：操作符，后跟要引用的函数名
    showOnBoard("牙膏",::getDiscountWords)

    showOnBoard("牙膏",getDiscountWords2)

}

private fun getDiscountWords(goodsName: String,hour: Int):String{
    val currentYear = 2027
    return "${currentYear}年，双11${goodsName}促销倒计时：$hour 小时"
}
val getDiscountWords2 = {goodsName:String, hour:Int ->
    val currentYear = 2027
    "${currentYear}年，双11${goodsName}促销倒计时：$hour 小时"
}
private fun showOnBoard(goodsName:String, getDiscountWords: (String,Int) -> String){
    val hour = (1..24).shuffled().last()
    println(getDiscountWords(goodsName,hour))
}

//const val MAX = 500